import json
from sdk.client import Client
from sdk.common import BuildClient

class Info:
    def __init__(self, client):
        self.client = client

    def get_device_setting_online_card_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceSettingOnlineCardInfo", get_params)

    def device_save_mode(self, req):
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        post_params = BuildClient.build_post_param(self,req.__dict__) 
        return self.client.post("/open/device/saveMode", post_params)
       
    def get_device_mode_time_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceModeTimeInfo", get_params)

    def get_device_mode_time1_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceModeTime1Info", get_params)

    def get_device_setting_coin_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceSettingCoinInfo", get_params)

    def find_multi_devices(self, req):
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        post_params = BuildClient.build_post_param(self,req.__dict__) 
        return self.client.post("/open/device/findMultiDevices", post_params)

    def device_add(self, req):
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        post_params = BuildClient.build_post_param(self,req.__dict__) 
        return self.client.post("/open/device/add", post_params)

    def get_device_mode_work_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceModeWorkInfo", get_params)

    def get_device_mode_work1_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceModeWork1Info", get_params)

    def get_device_mode_power_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceModePowerInfo", get_params)

    def get_device_mode_power1_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceModePower1Info", get_params)

    def find_list(self, req):
        get_params = {"device_num": req.device_num,"iot_phone":req.iot_phone,"device_type":req.device_type,"page_size":req.page_size,"page":req.page} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/findList", get_params)

    def device_del(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/del", get_params)

    def device_get_mode(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getMode", get_params)

    def get_device_setting_user_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceSettingUserInfo", get_params)

    def get_device_setting_not_disturb_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceSettingNotDisturbInfo", get_params)

    def device_find_one(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/findOne", get_params)

    def get_device_setting_offline_card_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceSettingOfflineCardInfo", get_params)

    def get_device_setting_safety_info(self, req):
        get_params = {"device_num": req.device_num} 
        self.app_id = self.client.app_id
        self.app_secret = self.client.app_secret
        get_params = BuildClient.build_get_param(self,get_params)
        return self.client.get("/open/device/getDeviceSettingSafetyInfo", get_params)


